The H.264 specification video codec contains a context adaptive binary arithmetic-coding (CABAC) method as part of a main profile. Every iteration of the CABAC method employs a context index to determine a model from a table upon which a single cycle of arithmetic coding is performed, after which a modified state is stored away. The CABAC method is computationally intensive and inherently serial in nature so effective use of CABAC hardware becomes imperative. However, for each video slice (which contains from one to a full frame of 16×16 macroblocks), an initial state of the context is reinitialized. With 399 contexts, each initialization consumes a considerable amount time. The initialization time is so significant that slice rate limits were added as a normative part of the H.264 specification. An added complication is an existence of four different sets of initialization parameters with the correct one being signaled in the bit stream at the start of a slice and a scaling factor (i.e., 0-51) applied to calculate the initial state for each context. Some slice types do not use all 399 contexts so some optimization is possible.
Several conventional solutions exist to perform the initialization. A first conventional solution is to loop through the 399 contexts, one at a time, and perform both a table lookup and scaling to determine the initial state. However, the time used to loop through the contexts and scale takes away from coding operation time. A second conventional solution is to loop through the 399 contexts and scaling several context at a time. The second solution involves multiple simultaneous initializations that increase a hardware cost (i.e., area) due to wider memory constraints and multiple scalars operating in parallel. A third conventional solution stores a pre-scaled table, loops through the 399 contexts and performs a table lookup to determine the initial state. However, storing all of the pre-scaled contexts consumes approximately 50 times the area for ROM storage as compared with the first conventional solution. A fourth conventional solution is to loop through a subset of the 399 contexts (i.e., approximately 300 contexts) depending upon the type of slice being processed. In practice, an implementation that uses a subset of the contexts provides only a marginal improvement.